import api from '@/common/api.js'


const RegisterLoginAccount = async (data, success, fail, isShowLoading = true) => {
	return await api.Request({
		url: '/api/services/app/WxUserInfo/RegisterLoginAccount',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isNotNeedToken: true,
		isEncrypt: true
	});
};
const GetUserDetail = async (data, success, fail, isShowLoading = true) => {
	return await api.Request({
		url: '/api/services/app/WxUserInfo/GetUserDetail',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isNotNeedToken: true,
		isEncrypt: true
	});
};

const GetUserInfo = async (data, success, fail, isShowLoading = false) => {
	return await api.Request({
		url: '/api/services/app/WxUserInfo/GetUserInfo',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isEncrypt: true
	});
};

const SaveUserInfo = async (data,success, fail,isShowLoading = true) => {
	return await api.Request({
		url: '/api/services/app/WxUserInfo/SaveUserInfo',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isEncrypt: true
	});
};

const GetMyUserInfo = async (data, success, fail, isShowLoading = true) => {
	return await api.Request({
		url: '/api/services/app/WxUserInfo/GetMyUserInfo',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isEncrypt: true
	});
};

const GetMyInviateLst = async (data, success, fail, isShowLoading = true) => {
	return await api.Request({
		url: '/api/services/app/WxUserInfo/GetMyInviateLst',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isEncrypt: false
	});
};

const GetMyMarketInfo = async (data, success, fail, isShowLoading = true) => {
	return await api.Request({
		url: '/api/services/app/WxUserInfo/GetMyMarketInfo',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isEncrypt: false
	});
};

const AddReceiveCode = async (data, success, fail, isShowLoading = true) => {
	return await api.Request({
		url: '/api/services/app/WxUserInfo/AddReceiveCode',
		data: data,
		isObj: true,
		isShowLoading: isShowLoading,
		abpSuccess: success,
		abpFail: fail,
		isEncrypt: false
	});
};


export default {
	GetMyInviateLst,
	RegisterLoginAccount,
	GetUserInfo,
	GetUserDetail,
	SaveUserInfo,
	GetMyUserInfo,
	GetMyMarketInfo,
	AddReceiveCode
};